<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
	ul{}
	li{}
	a{
		text-overflow: ellipsis; 
		-o-text-overflow: ellipsis; /*opear*/
		white-space: nowrap; 
		overflow: hidden;
		display: inline-block;
		width:110px;
	}
	.nav a .class{}/*for other*/
	.msie6 .nav a .class{}
	.msie .class ,.firefox .class{}
	a:after{
		content:"…"
		}
	.class{
		color:red;
		*ie7;
		_ie6;
	}
	ul{display:table-row;border:1px solid #cccccc;}
	ul li{display:table-cell; *display:inline-block;}
</style>
</head>

<body class="msie msie6">
<ul>
	<li><a href="#">中文的项目将表态</a></li>
    <li><a href="#">中文法规将表态</a></li>
    <li><a href="#">中地方将表态</a></li>
    <li><a href="#">中文法规将表态</a></li>
    <li><a href="#">中是否更合适的目将表态</a></li>
</ul>
<div id="uas"></div>
<div id="output"></div>
</body>
<script>
var ua =function(){
	var ua = navigator.userAgent.toLowerCase();
	document.getElementById("uas").innerHTML = ua;
	(s = ua.match(/msie ([\d.]{1})/g)) ? undefined :
	(s = ua.match(/firefox\/([\d.]{1})/g)) ? undefined :
	(s = ua.match(/chrome\/([\d.]{1})/g)) ? undefined :
	(s = ua.match(/opera.([\d.]{1})/g)) ? undefined :
	(s = ua.match(/version\/([\d.]{1}).*safari/g)) ? undefined : 0;
	//alert(s.toString())
	browser = s.toString().replace(/( )|(\/)|([\d.]+)/g,"");
	ver = s.toString().replace(/( )|(\/)/,"");
	
	return {browser:browser , ver :ver};
}

document.getElementById("output").innerHTML = "浏览器类型"+ua().browser + "版本" +ua().ver 
alert(ua().browser)
var browser = window.ActiveXObject && !window.XMLHttpRequest ? "ie6" :
window.ActiveXObject && window.XMLHttpRequest ? "ie7" :
window.opera ? "opera" :
window.execScript ?"chrome":
!navigator.taintEnabled ?"safari" :
window.Components ? "firefox":"unknown"
//alert(browser)

</script>
</html>
